<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Canvas绘制直线</title>
	</head>
	<body>
		<canvas id="oneCanvas" width="400" height="200" style="background: #F0F0F0;"></canvas>
		<script type="text/javascript">
			var myCanvas=document.getElementById("oneCanvas");
			var conText=myCanvas.getContext("2d");
			conText.strokeStyle="rgb(250,0,0)";
			conText.fillStyle="rgb(250,0,0)"
			conText.moveTo(10,10);
			conText.lineTo(10,150);
			conText.moveTo(10,150);
			conText.lineTo(100,180);
			conText.lineTo(200,10);
			conText.lineTo(400,100);
			conText.lineWidth=8;
			conText.stroke();
			
			
		</script>
	</body>
</html>
